Micron Document
██████╗ ███████╗████████╗██╗██████╗ ███████╗██████╗ ██╗ █████╗
██╔══██╗██╔════╝╚══██╔══╝██║██╔══██╗██╔════╝██╔══██╗██║██╔══██╗
██████╔╝█████╗ ██║ ██║██████╔╝█████╗ ██║ ██║██║███████║
██╔══██╗██╔══╝ ██║ ██║██╔═══╝ ██╔══╝ ██║ ██║██║██╔══██║
██║ ██║███████╗ ██║ ██║██║ ███████╗██████╔╝██║██║ ██║
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚═════╝ ╚═╝╚═╝ ╚═╝


🬧 The NomadNet Encyclopedia | Archives | Info
- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b- `b

🔍 Search

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

FLWOR
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
MATA MAIN Il linguaggio di programmazione mwbqXQuery definisce mwbgFLWOR (pronunciato mwbwflower - in italiano mwcafiore - anche abbreviato mwcqFLWR) come un'mwcgespressione che supporta mwcwiterazione e mwdabinding sulle mwdqvariabili dei risultati intermedi.

FLWOR è un mwdwacronimo, dove ogni lettera è l'iniziale di una mweaclausola:

• mwewmwfaFOR - crea una sequenza di nodi
• mwfgmwfwLET - collega una sequenza di nodi ad una variabile
• mwgqWHERE - filtra i nodi che soddisfano una mwggcondizione booleana
• mwhaORDER BY - ordina i nodi
• mwhgRETURN - viene valutata una volta per ogni nodo

FLWOR è vagamente analogo al costrutto mwiaSELECT-FROM-WHERE del linguaggio mwiqSQL e può essere usato per fornire funzionalità analoghe al mwigjoin ai documenti mwiwXML.

Contents


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Esempio

for $d in doc("Dipartimenti.xml")//numero_dipartimento
let $e := doc("Impiegati.xml")//impiegato[numero_dipartimento = $d]
where count($e) >= 10
order by avg($e/stipendio) descending
return
<dipartimento_grande>
{ $d,
<lavoratori>{count($e)}</lavoratori>,
<stipendio_medio>{avg($e/stipendio)}</stipendio_medio>
}
</dipartimento_grande>

La prima colonna della mwjwquery XQuery mostra le parole-chiave mwkaFOR, mwkqLET, mwkgWHERE, mwkwORDER BY e mwlaRETURN del paradigma FLWOR. In parole povere, questa potrebbe essere letta come "selezionare tutti i dipartimenti che hanno più di dieci impiegati, ordina questi dipartimenti in ordine decrescente sulla base dello stipendio mwlqmedio, e ritornare un rapporto sul numero di dipartimenti, sul conteggio dei lavoratori e sullo stipendio medio di ogni dipartimento grande".

Il risultato potrebbe essere:

<dipartimento_grande>
<numero_dipartimento>17</numero_dipartimento>
<lavoratori>25</lavoratori>
<stipendio_medio>12500</stipendio_medio>
</dipartimento_grande>
<dipartimento_grande>
<numero_dipartimento>24</numero_dipartimento>
<lavoratori>18</lavoratori>
<stipendio_medio>11327</stipendio_medio>
</dipartimento_grande>
<dipartimento_grande>
<numero_dipartimento>3</numero_dipartimento>
<lavoratori>32</lavoratori>
<stipendio_medio>10725</stipendio_medio>
</dipartimento_grande>

Collegamenti esterni

• mwvg(EN) W3C XML Query (XQuery) - Espressioni FLWOR, su w3.org.
• mwwa(EN) Esempi di FLWOR, su brics.dk. URL consultato il 25 marzo 2011 (archiviato dall'url originale il 4 giugno 2011).
• mwwg(EN) Introduzione al FLWOR, su stylusstudio.com.